<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 玩家管理 -->
<?php if($sysAct == "add" || $sysAct == "modify"){?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=userjs&act=list">玩家军队</a> &raquo;
	<?php if($sysAct == "add"){?>添加新军队<?php }else{ ?>编辑军队<?php } ?>
	<input type="button" value="军队列表" onclick="qgurl('admin.php?file=userjs&act=list')">
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<form method="post" action="admin.php?file=userjs&act=viewok&id=<?php echo $id;?>" onsubmit="return add_msg();">
<tr>
	<td class="left">所在城池：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="c_id" id="c_id" value="<?php echo $rsa[c_name];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">所属玩家：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="u_id" id="u_id" value="<?php echo $rsb[p_nickname];?>">
<span class="clue_on">[填写所属玩家的ID不是账号]</span>
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">步  卒：</td>
	<td class="right">
		<input type="text" name="bu_zhu" id="bu_zhu" value="<?php echo $rs[bu_zhu];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">探  子：</td>
	<td class="right">
		<input type="text" name="tan_zhi" id="tan_zhi" value="<?php echo $rs[tan_zhi];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">辎 重 兵：</td>
	<td class="right">
		<input type="text" name="zz_bing" id="zz_bing" value="<?php echo $rs[zz_bing];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">扑 刀 手：</td>
	<td class="right">
		<input type="text" name="pd_shou" id="pd_shou" value="<?php echo $rs[pd_shou];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">短 弓 手：</td>
	<td class="right">
		<input type="text" name="dg_shou" id="dg_shou" value="<?php echo $rs[dg_shou];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">白 耳 士：</td>
	<td class="right">
		<input type="text" name="be_shi" id="be_shi" value="<?php echo $rs[be_shi];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">白马义从：</td>
	<td class="right">
		<input type="text" name="bmy_chong" id="bmy_chong" value="<?php echo $rs[bmy_chong];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">筑 城 队：</td>
	<td class="right">
		<input type="text" name="zc_dui" id="zc_dui" value="<?php echo $rs[zc_dui];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">先登死士：</td>
	<td class="right">
		<input type="text" name="xds_shi" id="xds_shi" value="<?php echo $rs[xds_shi];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">辎 重 车：</td>
	<td class="right">
		<input type="text" name="zz_che" id="zz_che" value="<?php echo $rs[zz_che];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">陷 阵 营：</td>
	<td class="right">
		<input type="text" name="xz_ying" id="xz_ying" value="<?php echo $rs[xz_ying];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">近卫甲兵：</td>
	<td class="right">
		<input type="text" name="jwj_bing" id="jwj_bing" value="<?php echo $rs[jwj_bing];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">西凉铁骑：</td>
	<td class="right">
		<input type="text" name="xlt_qi" id="xlt_qi" value="<?php echo $rs[xlt_qi];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">无当飞军：</td>
	<td class="right">
		<input type="text" name="wdf_jun" id="wdf_jun" value="<?php echo $rs[wdf_jun];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">虎 豹 骑：</td>
	<td class="right">
		<input type="text" name="hb_qi" id="hb_qi" value="<?php echo $rs[hb_qi];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">霹 雳 车：</td>
	<td class="right">
		<input type="text" name="pl_che" id="pl_che" value="<?php echo $rs[pl_che];?>" >
	</td>
</tr>
</table>
</div>
<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">弩 炮 车：</td>
	<td class="right">
		<input type="text" name="np_che" id="np_che" value="<?php echo $rs[np_che];?>" >
	</td>
</tr>
</table>
</div>

<?php $button_msg = $sysAct == "modify" ? "编辑玩家" : "添加玩家";;?>
<div class="table">
<table width="100%">
<tr>
	<td class="left"></td>
	<td class="right"><input type="submit" id="creat_button" class="mybutton_01" value="<?php echo $button_msg;?>"> &nbsp; <span id="show_step" style="color:red;"></span></td>
</tr>
</form>
</table>
</div>
<script type="text/javascript">
function add_msg(msg)
{
	var username = $("username").value;
	if(!username)
	{
		alert("账号不允许为空");
		return false;
	}

	$("show_step").innerHTML = "<img src='admin/tpl/images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";

	$("creat_button").disabled = true;
}
</script>

<?php }elseif($sysAct == "list"){ ?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	玩家军队
	<input type="button" value="添加新军队" onclick="qgurl('admin.php?file=userjs&act=add')">
</div>

<div class="table">
	<table cellpadding="1" cellspacing="0">
	<form method="post" action="admin.php?file=userjs&act=list">
	<tr>
		<td><input type="text" name="keywords" id="keywords" value="<?php echo $keywords;?>"></td>
		<td>
			<select name="stype" id="stype">
			<option value="s_id"<?php if($stype == "s_id"){?> selected<?php } ?>>军队ID</option>
			<option value="c_id"<?php if($stype == "c_id"){?> selected<?php } ?>>所在城ID</option>
			<option value="u_id"<?php if($stype == "u_id"){?> selected<?php } ?>>所属君主ID</option>
			</select>
		</td>
		<td>
			<input type="submit" value="搜索" class="mybutton_01">
		</td>
		</form>
	</tr>
	</table>
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style="border-bottom:1px #D4D4D4 solid;"><img src="admin/tpl/images/blank.gif" border="0" width="1" height="1"></td>
</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0">
<tr class="table table2">
	<td height="23px" class="msg_subject_id b_b">军队编号</td>
	<td class="msg_subject b_b">所属君主</td>
	<td class="msg_subject b_b">所在城池</td>
	<td class="msg_subject b_b">军队总数</td>
	<td align="center" class="msg_subject b_b">操作</td>
</tr>
<?php $_i=0;$rslist=(is_array($rslist))?$rslist:array();foreach($rslist AS  $key=>$value){$_i++; ?>
<tr class="m_out" onmouseover="this.className='m_over'" onmouseout="this.className='m_out'">
	<td height="25px" align="center" class="b_b"><?php echo $value[s_id];?></td>
	<td align="left" class="b_b"><?php echo $value[u_id];?></td>
	<td align="left" class="b_b"><?php echo $value[c_id];?></td>
	<td align="left" class="b_b"><?php $ta=$value[bu_zhu]+$value[tan_zhi]+$value[zz_bing]+$value[pd_shou]+$value[dg_shou]+$value[be_shi]+$value[bmy_chong]+$value[zc_dui]+$value[xds_shi]+$value[np_che]+$value[zz_che]+$value[xz_ying]+$value[jwj_bing]+$value[xlt_qi]+$value[wdf_jun]+$value[hb_qi]+$value[pl_che];echo $ta;;?></td>
	<td align="center" class="b_b">
		<input type="button" value="编辑" class="mybutton_01" onclick="qg_modify(<?php echo $value[s_id];?>)">
		<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $value[s_id];?>)">
	</td>
</tr>
<?php } ?>
</table>

<div align="right"><?php echo $pagelist;?></div>
<script type="text/javascript">
function qg_modify(id)
{
	window.location.href="admin.php?file=userjs&act=modify&id="+id;
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=userjs&act=delete&id="+id);
	}
}
</script>
<?php } ?>